package com.lingnan.task;


import com.lingnan.service.InterviewReminderService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class InterviewReminderTask {
    
    private final InterviewReminderService interviewReminderService;
    
    /**
     * 每5分钟检查一次30分钟内的面试提醒
     */
    @Scheduled(cron = "0 */5 * * * ?")
    public void sendInterviewReminder30Minutes() {
        log.info("开始执行30分钟面试提醒任务");
        interviewReminderService.sendInterviewReminder30Minutes();
    }
    
    /**
     * 每10分钟检查一次1小时内的面试提醒
     */
    @Scheduled(cron = "0 */10 * * * ?")
    public void sendInterviewReminder1Hour() {
        log.info("开始执行1小时面试提醒任务");
        interviewReminderService.sendInterviewReminder1Hour();
    }
}